package com.cn.hnust.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.cn.hnust.entity.sc.Test;
import com.cn.hnust.service.sc.TestService;

@Controller
@RequestMapping("/test")
public class TestController {
	@Resource
	private TestService testService;
	
	@RequestMapping("/showTest")
	public String toIndex(HttpServletRequest request,Model model){
		String testId = request.getParameter("id");
		Test test = this.testService.getTestById(testId);
		model.addAttribute("test",test);
		return "showTest";
		
	}
}
